//玩家图标

var rankName = ["少尉","中尉","上尉","少校","中校","上校","少将","中将","上将"];

var CreatePlayerSprite = function(name, rank){
	if (rank < 1 || rank > 8)
		return null;
	
	var sprite = new cc.Sprite(resource.rank_png[rank - 1]);
	var label = cc.LabelTTF.create(name, "simhei", 48);
	
	var background = new cc.Scale9Sprite(resource.scale9halfblack100100_png, cc.rect(0,0,100,100), cc.rect(8,8,84,84));
	background.setContentSize(sprite.width + 250 + 16, sprite.height + 16);
	
	sprite.attr({ x : 8 + sprite.width * 0.5, y : 8 + sprite.height * 0.5 });
	label.attr({ x : 8 + sprite.width + 125, y : 8 + sprite.height * 0.5 });
	background.addChild(sprite);
	background.addChild(label);
	
	return background;
};